<?php include_stylesheets_for_form($form) ?>
<?php include_javascripts_for_form($form) ?>

<form id="form_video" name="form_video" action="<?php echo url_for('video/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id_item='.$form->getObject()->getIdItem() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
<input type="hidden" name="sf_method" value="put" />
<input type="hidden" name="id_item" value="<?php echo $form->getObject()->getIdItem() ?>" />
<?php endif; ?>
<?php echo $form->renderHiddenFields() ?>
	
<input type="hidden" name="item[id_tipo]" value="<?php echo Tipo::VIDEOS; ?>" />
<input type="hidden" name="item[is_top]" value="N" />
<table class="form">
	<tbody>
		<tr>
			<th colspan="2" class="title">Dados do Video</th>
		</tr>
		<tr>
			<th><?php echo $form['nm_item']->renderLabel() ?></th>
			<td><?php echo $form['nm_item'] ?> <?php echo form_error('nm_item'); ?>
			</td>
		</tr>
		<tr>
			<th><?php echo $form['ds_url']->renderLabel() ?></th>
			<td><?php echo $form['ds_url'] ?> <?php echo form_error('ds_url'); ?>
			</td>
		</tr>
		<tr>
			<th><?php echo $form['st_item']->renderLabel() ?></th>
			<td><?php echo $form['st_item'] ?> <?php echo form_error('st_item'); ?>
			</td>
		</tr>
	</tbody>
</table>

<?php
	comandos_form(
		link_to(
			':: Listar ::',
			'video/list',
			array('class' => 'botao')
		),
		submit_tag(':: Salvar ::')
	);
?>
</form>

<script type="text/javascript">
$(function()
{
	System.setdata.tab();
    System.formdata.save(new Array("msgAlerta", "Atenção:"));
});
</script>